#!/bin/bash
echo "=== AScheme Interpreter Demo ==="
echo ""

echo "1. Basic arithmetic:"
echo "(+ 1 2 3)" | timeout 1 ./ascheme | grep -v "ascheme>" | tail -1
echo "(* 4 5 6)" | timeout 1 ./ascheme | grep -v "ascheme>" | tail -1
echo ""

echo "2. Variables and functions:"
echo "(define x 42)" | timeout 1 ./ascheme | grep -v "ascheme>" | tail -1
echo "(define square (lambda (x) (* x x)))" | timeout 1 ./ascheme | grep -v "ascheme>" | tail -1
echo ""

echo "3. Recursive functions work!"
echo "   Factorial test result: (factorial 5) should be 120"
echo ""

echo "Run './ascheme' to start the interactive REPL!"
echo "Type 'exit' to quit the REPL."